using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudFirmaKullaniciDao : BaseEntity
	{
		private readonly string fromHql = " from CloudFirmaKullanici as t ";
		public void Insert(CloudFirmaKullanici dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudFirmaKullanici dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudFirmaKullanici dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int firmaKullaniciId)
		{
			CloudFirmaKullanici dto = new CloudFirmaKullanici();
			dto.FirmaKullaniciId = firmaKullaniciId;
			Delete(dto);
		}

		public CloudFirmaKullanici Get(int firmaKullaniciId, LockMode lockMode)
		{
			return Get<CloudFirmaKullanici>(firmaKullaniciId, lockMode);
		}

		public List<CloudFirmaKullanici> FindAll()
		{
			return Find<CloudFirmaKullanici>(fromHql, LockMode.Read);
		}

		public List<CloudFirmaKullanici> FindAll(string orderStatement)
		{
			return Find<CloudFirmaKullanici>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
